package com.digitalchina.lxnsy.api;

import android.app.Activity;
import android.os.Handler;

import com.digitalchina.lxnsy.constant.MSG;
import com.digitalchina.lxnsy.constant.URL;
import com.digitalchina.lxnsy.toolkit.OkHttpUtil;
import com.digitalchina.lxnsy.xml.UserXML;
import com.lzy.okhttputils.model.HttpParams;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.api
 * 创建人：郑皓
 * 创建时间：2018/1/13 15:03
 * 修改备注：
 * ================================================
 */
public class BusinessMyEnterprise {

    /**
     * 我的企业列表
     *
     * @param activity
     * @param handler
     */
    public static void myEnterpriseList(Activity activity, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("userAccId", UserXML.getUserId(activity));

        OkHttpUtil.post(activity, URL.URL_MY_ENTERPRISE_LIST, "", params, handler, MSG.MSG_MY_ENTERPRISE_LIST_SUCCESS, MSG.MSG_MY_ENTERPRISE_LIST_FIELD);

    }

    /**
     * 取消或关注企业
     *
     * @param activity
     * @param enterpriseId 企业Id
     * @param isConcern    0取消 1关注
     * @param handler
     */
    public static void concernEnterprise(Activity activity, String enterpriseId, String isConcern, Handler handler) {

        HttpParams params = new HttpParams();
        params.put("userAccId", UserXML.getUserId(activity));
        params.put("enterpriseId", enterpriseId);
        params.put("isConcern", isConcern);

        OkHttpUtil.post(activity, URL.URL_CONCERN_ENTERPRISE, "", params, handler, MSG.MSG_CONCERN_ENTERPRISE_SUCCESS, MSG.MSG_CONCERN_ENTERPRISE_FIELD);

    }
}
